Optimal. Leaf size=62 \[ -\frac {b^{3/2} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^2}-\frac {(a+3 b) \tanh ^{-1}(\cos (x))}{2 (a+b)^2}-\frac {\cot (x) \csc (x)}{2 (a+b)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3269, 425, 536,
212, 211} \begin {gather*} -\frac {b^{3/2} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^2}-\frac {(a+3 b) \tanh ^{-1}(\cos (x))}{2 (a+b)^2}-\frac {\cot (x) \csc (x)}{2 (a+b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 212
Rule 425
Rule 536
Rule 3269
Rubi steps
\begin {align*} \int \frac {\csc ^3(x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{\left (1-x^2\right )^2 \left (a+b x^2\right )} \, dx,x,\cos (x)\right )\\ &=-\frac {\cot (x) \csc (x)}{2 (a+b)}-\frac {\text {Subst}\left (\int \frac {a+2 b+b x^2}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\cos (x)\right )}{2 (a+b)}\\ &=-\frac {\cot (x) \csc (x)}{2 (a+b)}-\frac {b^2 \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\cos (x)\right )}{(a+b)^2}-\frac {(a+3 b) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (x)\right )}{2 (a+b)^2}\\ &=-\frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^2}-\frac {(a+3 b) \tanh ^{-1}(\cos (x))}{2 (a+b)^2}-\frac {\cot (x) \csc (x)}{2 (a+b)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(140\) vs. \(2(62)=124\).
time = 0.57, size = 140, normalized size = 2.26 \begin {gather*} \frac {-8 b^{3/2} \text {ArcTan}\left (\frac {\sqrt {b}-\sqrt {a+b} \tan \left (\frac {x}{2}\right )}{\sqrt {a}}\right )-8 b^{3/2} \text {ArcTan}\left (\frac {\sqrt {b}+\sqrt {a+b} \tan \left (\frac {x}{2}\right )}{\sqrt {a}}\right )+\sqrt {a} \left (-\left ((a+b) \csc ^2\left (\frac {x}{2}\right )\right )-4 (a+3 b) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )+(a+b) \sec ^2\left (\frac {x}{2}\right )\right )}{8 \sqrt {a} (a+b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 95, normalized size = 1.53
method | result | size |
default | \(\frac {1}{\left (4 a +4 b \right ) \left (\cos \left (x \right )+1\right )}+\frac {\left (-a -3 b \right ) \ln \left (\cos \left (x \right )+1\right )}{4 \left (a +b \right )^{2}}+\frac {1}{\left (4 a +4 b \right ) \left (-1+\cos \left (x \right )\right )}+\frac {\left (a +3 b \right ) \ln \left (-1+\cos \left (x \right )\right )}{4 \left (a +b \right )^{2}}-\frac {b^{2} \arctan \left (\frac {b \cos \left (x \right )}{\sqrt {a b}}\right )}{\left (a +b \right )^{2} \sqrt {a b}}\) | \(95\) |
risch | \(\frac {{\mathrm e}^{3 i x}+{\mathrm e}^{i x}}{\left ({\mathrm e}^{2 i x}-1\right )^{2} \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{i x}-1\right ) a}{2 a^{2}+4 a b +2 b^{2}}+\frac {3 \ln \left ({\mathrm e}^{i x}-1\right ) b}{2 \left (a^{2}+2 a b +b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{i x}+1\right ) a}{2 \left (a^{2}+2 a b +b^{2}\right )}-\frac {3 \ln \left ({\mathrm e}^{i x}+1\right ) b}{2 \left (a^{2}+2 a b +b^{2}\right )}-\frac {i \sqrt {a b}\, b \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i x}}{b}+1\right )}{2 a \left (a +b \right )^{2}}+\frac {i \sqrt {a b}\, b \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i x}}{b}+1\right )}{2 a \left (a +b \right )^{2}}\) | \(206\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 105 vs.
\(2 (50) = 100\).
time = 0.48, size = 105, normalized size = 1.69 \begin {gather*} -\frac {b^{2} \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a b}} - \frac {{\left (a + 3 \, b\right )} \log \left (\cos \left (x\right ) + 1\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {{\left (a + 3 \, b\right )} \log \left (\cos \left (x\right ) - 1\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {\cos \left (x\right )}{2 \, {\left ({\left (a + b\right )} \cos \left (x\right )^{2} - a - b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 124 vs.
\(2 (50) = 100\).
time = 0.46, size = 274, normalized size = 4.42 \begin {gather*} \left [\frac {2 \, {\left (b \cos \left (x\right )^{2} - b\right )} \sqrt {-\frac {b}{a}} \log \left (\frac {b \cos \left (x\right )^{2} - 2 \, a \sqrt {-\frac {b}{a}} \cos \left (x\right ) - a}{b \cos \left (x\right )^{2} + a}\right ) + 2 \, {\left (a + b\right )} \cos \left (x\right ) - {\left ({\left (a + 3 \, b\right )} \cos \left (x\right )^{2} - a - 3 \, b\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left ({\left (a + 3 \, b\right )} \cos \left (x\right )^{2} - a - 3 \, b\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - 2 \, a b - b^{2}\right )}}, -\frac {4 \, {\left (b \cos \left (x\right )^{2} - b\right )} \sqrt {\frac {b}{a}} \arctan \left (\sqrt {\frac {b}{a}} \cos \left (x\right )\right ) - 2 \, {\left (a + b\right )} \cos \left (x\right ) + {\left ({\left (a + 3 \, b\right )} \cos \left (x\right )^{2} - a - 3 \, b\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left ({\left (a + 3 \, b\right )} \cos \left (x\right )^{2} - a - 3 \, b\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - a^{2} - 2 \, a b - b^{2}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc ^{3}{\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 103 vs.
\(2 (50) = 100\).
time = 0.43, size = 103, normalized size = 1.66 \begin {gather*} -\frac {b^{2} \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a b}} - \frac {{\left (a + 3 \, b\right )} \log \left (\cos \left (x\right ) + 1\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {{\left (a + 3 \, b\right )} \log \left (-\cos \left (x\right ) + 1\right )}{4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {\cos \left (x\right )}{2 \, {\left (\cos \left (x\right )^{2} - 1\right )} {\left (a + b\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.59, size = 1138, normalized size = 18.35 \begin {gather*} \ln \left (\cos \left (x\right )-1\right )\,\left (\frac {b}{2\,{\left (a+b\right )}^2}+\frac {1}{4\,\left (a+b\right )}\right )-\frac {\cos \left (x\right )}{2\,{\sin \left (x\right )}^2\,\left (a+b\right )}-\frac {\ln \left (\cos \left (x\right )+1\right )\,\left (a+3\,b\right )}{4\,{\left (a+b\right )}^2}-\frac {\mathrm {atan}\left (\frac {\frac {\sqrt {-a\,b^3}\,\left (\frac {\cos \left (x\right )\,\left (a^2\,b^3+6\,a\,b^4+13\,b^5\right )}{4\,\left (a^2+2\,a\,b+b^2\right )}+\frac {\left (\frac {2\,a^5\,b^2+12\,a^4\,b^3+28\,a^3\,b^4+32\,a^2\,b^5+18\,a\,b^6+4\,b^7}{2\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}-\frac {\cos \left (x\right )\,\sqrt {-a\,b^3}\,\left (-16\,a^5\,b^2-48\,a^4\,b^3-32\,a^3\,b^4+32\,a^2\,b^5+48\,a\,b^6+16\,b^7\right )}{8\,\left (a^2+2\,a\,b+b^2\right )\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )\,\sqrt {-a\,b^3}}{2\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )\,1{}\mathrm {i}}{a^3+2\,a^2\,b+a\,b^2}+\frac {\sqrt {-a\,b^3}\,\left (\frac {\cos \left (x\right )\,\left (a^2\,b^3+6\,a\,b^4+13\,b^5\right )}{4\,\left (a^2+2\,a\,b+b^2\right )}-\frac {\left (\frac {2\,a^5\,b^2+12\,a^4\,b^3+28\,a^3\,b^4+32\,a^2\,b^5+18\,a\,b^6+4\,b^7}{2\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}+\frac {\cos \left (x\right )\,\sqrt {-a\,b^3}\,\left (-16\,a^5\,b^2-48\,a^4\,b^3-32\,a^3\,b^4+32\,a^2\,b^5+48\,a\,b^6+16\,b^7\right )}{8\,\left (a^2+2\,a\,b+b^2\right )\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )\,\sqrt {-a\,b^3}}{2\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )\,1{}\mathrm {i}}{a^3+2\,a^2\,b+a\,b^2}}{\frac {\frac {3\,b^5}{2}+\frac {a\,b^4}{2}}{a^3+3\,a^2\,b+3\,a\,b^2+b^3}-\frac {\sqrt {-a\,b^3}\,\left (\frac {\cos \left (x\right )\,\left (a^2\,b^3+6\,a\,b^4+13\,b^5\right )}{4\,\left (a^2+2\,a\,b+b^2\right )}+\frac {\left (\frac {2\,a^5\,b^2+12\,a^4\,b^3+28\,a^3\,b^4+32\,a^2\,b^5+18\,a\,b^6+4\,b^7}{2\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}-\frac {\cos \left (x\right )\,\sqrt {-a\,b^3}\,\left (-16\,a^5\,b^2-48\,a^4\,b^3-32\,a^3\,b^4+32\,a^2\,b^5+48\,a\,b^6+16\,b^7\right )}{8\,\left (a^2+2\,a\,b+b^2\right )\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )\,\sqrt {-a\,b^3}}{2\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )}{a^3+2\,a^2\,b+a\,b^2}+\frac {\sqrt {-a\,b^3}\,\left (\frac {\cos \left (x\right )\,\left (a^2\,b^3+6\,a\,b^4+13\,b^5\right )}{4\,\left (a^2+2\,a\,b+b^2\right )}-\frac {\left (\frac {2\,a^5\,b^2+12\,a^4\,b^3+28\,a^3\,b^4+32\,a^2\,b^5+18\,a\,b^6+4\,b^7}{2\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}+\frac {\cos \left (x\right )\,\sqrt {-a\,b^3}\,\left (-16\,a^5\,b^2-48\,a^4\,b^3-32\,a^3\,b^4+32\,a^2\,b^5+48\,a\,b^6+16\,b^7\right )}{8\,\left (a^2+2\,a\,b+b^2\right )\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )\,\sqrt {-a\,b^3}}{2\,\left (a^3+2\,a^2\,b+a\,b^2\right )}\right )}{a^3+2\,a^2\,b+a\,b^2}}\right )\,\sqrt {-a\,b^3}\,1{}\mathrm {i}}{a^3+2\,a^2\,b+a\,b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________